package 笔记.设计模式.单例模式;

/**
 * @author chenhailong
 * @ClassName: HungryMan
 * @Description: 饿汉
 * @date 2021/6/27 16:39
 * @Version 1.0
 */
public class HungryMan {

    // 创建方法私有
    private HungryMan () {
    }

    private static class HungryManHolder {
        private static HungryMan hungryMan = new HungryMan();
    }


    // 对外提供获取对象的方法
    public static HungryMan getHungryMan() {

        return HungryManHolder.hungryMan;
    }





}
